<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:libxslt="http://xmlsoft.org/XSLT/namespace" xmlns:exsl="http://exslt.org/common">
	<xsl:output method="xml" encoding="ISO-8859-1" indent="yes"/>
	<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
	<xsl:template match="/">
		<!--	KolSearch, Wiki, Forum, Web -->
		<xsl:variable name="mode">
			<xsl:choose>
				<xsl:when test="/*/@mode and /*/@mode!=''">
					<xsl:value-of select="/*/@mode"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>KolSearch</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<!-- searchterm -->
		<xsl:variable name="q">
			<xsl:choose>
				<xsl:when test="/*/@q and /*/@q!=''">
					<xsl:value-of select="/*/@q"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
		<html>
			<head>
				<title>KolSearch</title>
				<style>
					<xsl:comment>
						body,td,a,p,.h
						{	font-family:arial,sans-serif	}
						.h
						{	font-size:20px	}
						.h
						{	color:#3366cc	}
						.q
						{	color:#00c		}	
					</xsl:comment>
				</style>
				<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
				<!-- concat URL and searchterm -->
				<script type="text/javascript">
					function gotoURL(s)
					{
						window.location.href = s + "q=" + document.searchbox.q.value;
					}
				</script>
			</head>
			<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
			<body topmargin="3" alink="#ff0000" bgcolor="#ffffff" link="#0000cc" marginheight="3" text="#000000">
				<center>
					<!-- placeholder -->
					<div nowrap="" style="padding-bottom: 4px;" width="100%" align="right"> &#160;
						<!--						<font size="-1">
							<b>
								<xsl:value-of select="$mode"/>
							</b>
						
						</font>
-->
					</div>
					<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
					<!-- top -->
					<table>
						<tbody>
							<tr>
								<td>
									<a href="http://www.kingdomofloathing.com">
										<img src="./graphics/leftswordguy.gif" alt="Kingdom Of Loathing" title="Kingdom Of Loathing" border="0" height="100"/>
									</a>
								</td>
								<td>
									<span style="font-size: x-large;">
										<b>KoL Search</b>
									</span>
								</td>
								<td>
									<a href="http://www.kingdomofloathing.com">
										<img src="./graphics/rightswordguy.gif" alt="Kingdom Of Loathing" title="Kingdom Of Loathing" border="0" height="100"/>
									</a>
								</td>
							</tr>
						</tbody>
					</table>
					<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
					<xsl:choose>
						<xsl:when test="$mode='KolSearch'">
							<!-- Google CSE Search Box Begins -->
							<form id="searchbox_012506400200749089430:_jnsg44nrfm" action="http://www.google.com/cse" name="searchbox">
								<input type="hidden" name="cx" value="012506400200749089430:_jnsg44nrfm"/>
								<input type="hidden" name="cof" value="FORID:0"/>
								<!-- create the links to different search modes -->
								<xsl:call-template name="buildLinkBar">
									<xsl:with-param name="mode" select="$mode"/>
								</xsl:call-template>
								<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
								<table cellpadding="0" cellspacing="0">
									<tbody>
										<tr valign="top">
											<td width="25%"> </td>
											<td align="center" nowrap="nowrap">
												<!-- searchbox -->
												<input maxlength="2048" name="q" size="40" title="KoL Search (a Custom Google Search)">
													<xsl:attribute name="value">
														<xsl:value-of select="$q"/>
													</xsl:attribute>
												</input>
												<!-- button -->
												<input type="submit" name="sa" value="Search" title="KoL Search (a Custom Google Search)"/>

												<br/>
											</td>
											<td nowrap="nowrap" width="25%">
												<!-- placeholder -->
												<!--								<font size="-2">&nbsp;&nbsp;<a href="http://www.google.de/advanced_search?hl=en">Advanced Search</a><br/>&nbsp;&nbsp;<a href="http://www.google.de/preferences?hl=en"
									>Preferences</a><br/>&nbsp;&nbsp;<a href="http://www.google.de/language_tools?hl=en">Language Tools</a></font>
-->
											</td>
										</tr>
										<tr>
											<td colspan="3" align="center">
												<font size="-1"/>
											</td>
										</tr>
									</tbody>
								</table>
							</form>
							<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_012506400200749089430%3A_jnsg44nrfm"/>
							<!-- Google CSE Search Box Ends -->
						</xsl:when>
						<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
						<xsl:otherwise>
							<form id="searchbox" name="searchbox">
								<xsl:attribute name="action">
									<xsl:text>search</xsl:text>
								</xsl:attribute>
								<input type="hidden" name="mode">
									<xsl:attribute name="value">
										<xsl:value-of select="$mode"/>
									</xsl:attribute>
								</input>
								<!-- create links to different search modes -->
								<xsl:call-template name="buildLinkBar">
									<xsl:with-param name="mode" select="$mode"/>
								</xsl:call-template>
								<table cellpadding="0" cellspacing="0">
									<!-- title for searchbox and button -->
									<xsl:variable name="title">
										<xsl:choose>
											<xsl:when test="$mode='Wiki'">
												<xsl:text>TheKOLWiki Search</xsl:text>
											</xsl:when>
											<xsl:when test="$mode='Forum'">
												<xsl:text>Forums Of Loathing Search</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:text>Google Web Search</xsl:text>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<tbody>
										<tr valign="top">
											<td width="25%"> </td>
											<td align="center" nowrap="nowrap">
												<!-- searchbox -->
												<input maxlength="2048" name="q" size="40">
													<xsl:attribute name="value">
														<xsl:value-of select="$q"/>
													</xsl:attribute>
													<xsl:attribute name="title">
														<xsl:value-of select="$title"/>
													</xsl:attribute>
												</input>
												<!-- button -->
												<input type="submit" name="sa" value="Search">
													<xsl:attribute name="title">
														<xsl:value-of select="$title"/>
													</xsl:attribute>
												</input>
												<br/>
											</td>
											<!-- placeholder -->
											<td nowrap="nowrap" width="25%">
												<!--								<font size="-2">&nbsp;&nbsp;<a href="http://www.google.de/advanced_search?hl=en">Advanced Search</a><br/>&nbsp;&nbsp;<a href="http://www.google.de/preferences?hl=en"
													>Preferences</a><br/>&nbsp;&nbsp;<a href="http://www.google.de/language_tools?hl=en">Language Tools</a></font>
												-->
											</td>
										</tr>
										<tr>
											<td colspan="3" align="center">
												<font size="-1"/>
											</td>
										</tr>
									</tbody>
								</table>
							</form>
							<!-- Google CSE Search Box Ends -->
						</xsl:otherwise>
					</xsl:choose>
					<br/>
					<font size="-1">Homepage of this custom search can be found <a href="http://www.google.com/coop/cse?cx=012506400200749089430%3A_jnsg44nrfm">here</a>. </font>
					<br/>
					<br/>
					<br/>
					<font size="-1"><a href="http://www.kingdomofloathing.com">Kingdom Of Loathing</a> - <a href="http://kol.coldfront.net">Coldfront</a> - <a href="http://www.thekolwiki.net">KolWiki</a> - <a
							href="http://asymmetric.net/">asymmetric.net</a></font>
				</center>
			</body>
		</html>
	</xsl:template>
	<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
	<xsl:template name="buildLinkBar">
		<xsl:param name="mode"/>
		<table border="0" cellpadding="4" cellspacing="0">
			<tbody>
				<tr>
					<td nowrap="nowrap">
						<font size="-1">
							<xsl:choose>
								<xsl:when test="$mode='KolSearch'">
									<b>KolSearch</b>
								</xsl:when>
								<xsl:otherwise>
									<a method="post" class="q" href="javascript:gotoURL('/?mode=KolSearch&amp;')">KolSearch</a>
								</xsl:otherwise>
							</xsl:choose>
							<span>
								<xsl:text>&#160;&#160;</xsl:text>
							</span>
							<xsl:choose>
								<xsl:when test="$mode='Wiki'">
									<b>KolWiki</b>
								</xsl:when>
								<xsl:otherwise>
									<a class="q" href="javascript:gotoURL('/?mode=Wiki&amp;')">KolWiki</a>
								</xsl:otherwise>
							</xsl:choose>
							<span>
								<xsl:text>&#160;&#160;</xsl:text>
							</span>
							<xsl:choose>
								<xsl:when test="$mode='Forum'">
									<b>Forum</b>
								</xsl:when>
								<xsl:otherwise>
									<a class="q" href="javascript:gotoURL('/?mode=Forum&amp;')">Forum</a>
								</xsl:otherwise>
							</xsl:choose>
							<span>
								<xsl:text>&#160;&#160;</xsl:text>
							</span>
							<xsl:choose>
								<xsl:when test="$mode='Web'">
									<b>Web</b>
								</xsl:when>
								<xsl:otherwise>
									<a class="q" href="javascript:gotoURL('/?mode=Web&amp;')">Web</a>
								</xsl:otherwise>
							</xsl:choose>
							<!-- I know, its shit. But Im too lazy now... -->
							<span>
								<xsl:text>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</xsl:text>
							</span>
							<br/>
						</font>
					</td>
				</tr>
			</tbody>
		</table>
	</xsl:template>
	<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
	<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
</xsl:stylesheet>
